<template>
  <div class="OptionsPage">
    <van-nav-bar
      left-arrow
      title="注销账号"
      @click-left="onClickLeft"
      :border="false"
    />
    <div class="closeWrap">
      申请注销手工客账号
      <br />
      <div class="oldPwd"></div>
      <button class="applyClose" @click="isShow = true">申请注销</button>
      <!-- teleport:传送 to="标签" -->
      <teleport to="html">
        <div v-if="isShow" class="mark">
          <div class="dialog">
            确定注销此账号吗?
            <div class="oldPwd"></div>
            <button class="cancelButton" @click="isShow = false">取消</button>
            <button class="sureButton" @click="sure">确定</button>
          </div>
        </div>
      </teleport>
    </div>
  </div>
</template>
<script setup lang="ts">
import { ref } from "vue";
import { useRouter } from "vue-router";
const router = useRouter();
var isShow = ref(false);
const onClickLeft = () => history.back();
function changeInfo() {
  router.push({
    name: "changeInfo",
  });
}
function sure() {
  router.push({
    name: "my",
  });
}
</script>
<style scpped>
.OptionsPage {
  height: 100vh;
  width: 100vw;
  background-color: rgba(0, 0, 0, 0.047);
  position: relative;
}
img {
  width: 50px;
  height: 50px;
  border-radius: 50%;
}
.van-cell {
  align-items: center;
}
.oldPwd {
  width: 100%;
  height: 50px;
}

.closeWrap {
  width: 300px;
  height: 100px;
  /* border: 1px solid blue; */
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}
.applyClose {
  width: 150px;
  border-radius: 5px;
  background-color: red;
  color: white;
}
.mark {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: rgba(0, 0, 0, 0.5);
}
.dialog {
  width: 260px;
  height: 150px;
  background-color: white;
  border-radius: 5px;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  padding: 20px;
}
.dialog > button {
  width: 100px;
  height: 30px;
  border-radius: 20px;
  margin-right: 20px;
}
.cancelButton {
  background-color: red;
  color: white;
}
.sureButton {
  background-color: white;
  color: red;
}
</style>
<style>
.van-icon-arrow-left:before {
  color: gray;
  /* float: center; */
}
.van-nav-bar__text {
  color: gray;
}
</style>